package com.atcx.aspectj;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * Copyright (C), 2017-2022, MIDOU
 * ClassName: MyAspect
 * Author:   pangshu
 * Date:     2022/7/21 14:58
 * Version: 1.0
 * Description:
 */
@Component
@Aspect
public class MyAspect {

    @Around("b()")
    public Object around(ProceedingJoinPoint point) throws Throwable {
        System.out.println("before..................");
        Object proceed = point.proceed();
        System.out.println("after...................");
        return proceed;
    }

    @Pointcut("execution(* com.atcx.service.impl.UserServiceImpl.getUserById(..))")
    public void b(){

    }
}
